
//  UIColor+AddColor.m
//  FlatUI
//
//  Created by lzhr on 5/3/13.
//  Copyright (c) 2013 lzhr. All rights reserved.
//

#import "UIColor+AddColor.h"

@implementation UIColor (AddColor)


+ (UIColor *) colorFromHexCode:(NSString *)hexString {
    NSString *cleanString = [hexString stringByReplacingOccurrencesOfString:@"#" withString:@""];
    if([cleanString length] == 3) {
        cleanString = [NSString stringWithFormat:@"%@%@%@%@%@%@",
                       [cleanString substringWithRange:NSMakeRange(0, 1)],[cleanString substringWithRange:NSMakeRange(0, 1)],
                       [cleanString substringWithRange:NSMakeRange(1, 1)],[cleanString substringWithRange:NSMakeRange(1, 1)],
                       [cleanString substringWithRange:NSMakeRange(2, 1)],[cleanString substringWithRange:NSMakeRange(2, 1)]];
    }
    if([cleanString length] == 6) {
        cleanString = [cleanString stringByAppendingString:@"ff"];
    }
    
    unsigned int baseValue;
    [[NSScanner scannerWithString:cleanString] scanHexInt:&baseValue];
    
    float red = ((baseValue >> 24) & 0xFF)/255.0f;
    float green = ((baseValue >> 16) & 0xFF)/255.0f;
    float blue = ((baseValue >> 8) & 0xFF)/255.0f;
    float alpha = ((baseValue >> 0) & 0xFF)/255.0f;
    
    return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}

+ (UIColor *) ngaBackColor
{
    return [UIColor colorFromHexCode:@"EDEDED"];

}

+ (UIColor *) ngaDarkColor
{
    return [UIColor colorFromHexCode:@"EDEDED"];
}
+ (UIColor *)testColor{
    return [UIColor colorFromHexCode:@"EDEDED"];
}

+ (UIColor *) lightGreenColour {
    return [UIColor colorFromHexCode:@"E0FFFF"];
}
// 发现页面的按钮的颜色
+ (UIColor *) pupleAddColour {
    return [UIColor colorFromHexCode:@"00CD00"];
}
//  按钮的颜色
+ (UIColor *) jianbianWhiteColour {
    return [UIColor colorFromHexCode:@"AB82FF"];
}
+ (UIColor *) huiColour {
    return [UIColor colorFromHexCode:@"858585"];
}
// 导航栏的颜色
+ (UIColor *)lanColour {
    return [UIColor colorFromHexCode:@"87CEEB"];
}

// cell的底色
+(UIColor *)lvColour
{
    return [UIColor colorFromHexCode:@"FFF0F5"];
}
+ (UIColor *)nightColor{
    return [UIColor colorFromHexCode:@"424242"];
}
// cell上的view的颜色
+ (UIColor *)baiColor{
    return [UIColor colorFromHexCode:@"FFFAFA"];
}
// 浅蓝
+ (UIColor *)lightBlue
{
    return [UIColor colorFromHexCode:@"#00BFFF"];
}

@end